<% %>
<h1 class=subTitle>Time logs of <%=@name%></h1>
<div class="new_item" id=Tabs>
  <span id="new_item">
     <a href=# onclick="Effect.BlindDown('new_item_form');Element.hide('new_item');Element.show('cancel_new_item')">New Time</a>
  </span>
  <span id="cancel_new_item" style="background:yellow;display:none">
     <a href=# onclick="Effect.BlindUp('new_item_form');Element.show('new_item');Element.hide('cancel_new_item')">Cancel New Time</a>
  </span>
  <%=link_to "Back",:controller=>'login',:action=>'loginSuccess'%>
</div>

<%= render :partial =>'shared/remote_new_form' %>
<table class=data>
 <tr>
   <td> Project </td>
   <td> Total Hours</td>
   <td> User Hours</td>
  </tr>
<%@user.projects.each do |p|%>
 <tr>
   <td> <%=link_to p.name,:controller=>'project',:action=>'show',:id=>p.id%></td>
   <td> <%=p.total_hours%> </td>
   <td> 
     <%p.users.each do |u|%>
	  <%=image_tag (p.user_is_manager?(u.id)?"Manager":"Employee")+".gif"%>
       <%=link_to u.username,:controller=>'user',:action=>'show',:id=>u.id%>:
       <%=sprintf('%0.2f',p.hours(u.id))%>hours</br>
	 <%end%>
   </td>
 </tr>
<%end%>
</table>

